<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:45:"themes/admin_simpleboot3/admin/user/edit.html";i:1597905304;s:43:"themes/admin_simpleboot3/public/header.html";i:1584585426;}*/ ?>
<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->
    <title><?php echo Config('web_name'); ?></title>

    <link href="__TMPL__/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="__TMPL__/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="__STATIC__/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "__ROOT__/",
            WEB_ROOT: "__WEB_ROOT__/",
            JS_ROOT: "static/js/",
            APP: '<?php echo \think\Request::instance()->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="__TMPL__/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="__STATIC__/js/wind.js"></script>
    <script src="__TMPL__/public/assets/js/bootstrap.min.js"></script>
    <script src="__TMPL__/public/assets/js/echarts.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip();
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
</head>
<body>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>

<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li><a href="<?php echo url('user/index'); ?>">员工管理</a></li>
			<li class="active"><a href="javascript:;">员工编辑</a></li>
		</ul>
	<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="<?php echo url('user/editPost'); ?>">
    <input type="hidden" name="id" value="<?php echo $id; ?>" />
		 <div class="row">
		 <div class="col-md-9">
		  <table class="table table-bordered">
  	        <tr>
                <th style="width: 170px">工号</th>
                <td>
                    <input type="text" class="form-control border_class" name="post[employee_id]" value="<?php echo $employee_id; ?>" autocomplete="off">
                </td>
                <th style="width: 170px">姓名</th>
                <td>
                   <input type="text" class="form-control" id="input-user_login" name="post[user_login]" value="<?php echo $user_login; ?>" required="required">
                </td>
            </tr>
            <tr>
                <th style="width: 170px">手机号码</th>
                <td>
                   <input type="text" class="form-control"  name="post[mobile]" value="<?php echo $mobile; ?>" autocomplete="off">
                </td>
                <th>角色</th>
                <td>
                    <select class="form-control" name='role_id'><?php echo $roleList; ?></select>
                    <input type="hidden" name="company_id" value="<?php echo $company['id']; ?>">
                </td>
            </tr>
            <?php if(cmf_get_current_admin_id() == 1): ?>
            <tr>
                <th style="width: 170px"><?php echo lang('PASSWORD'); ?></th>
                <td>
                    <input type="password" class="form-control" id="input-user_pass" name="user_pass" value="" autocomplete="new-password">
                </td>
                <th style="width: 170px">重复密码</th>
                <td>
                    <input type="password" class="form-control" id="input-d_pass" name="d_pass" value="" autocomplete="new-password">
                </td>
            </tr>
            <?php endif; ?>
            <tr>
                <th>性别</th>
                <td>
                    <select class="form-control border_class" name='post[sex]'>
                        <option value="0" <?php if($sex == 0): ?>selected="selected"<?php endif; ?> >保密</option>
                        <option value="1" <?php if($sex == 1): ?>selected="selected"<?php endif; ?> >男</option>
                        <option value="2" <?php if($sex == 2): ?>selected="selected"<?php endif; ?> >女</option>
                    </select>
                </td>
                <th>生日</th>
                <td>
                    <input type="date" class="form-control border_class" name="post[birthday]" value="<?php echo $birthday; ?>" autocomplete="off">
                </td>
            </tr>
            <tr>

            </tr>
			</table>
      <!--角色弹窗-->
      <div id="roleselect_tc" style="display: none;">
          <div id="roleselect_list" style="margin: 5px;"></div>
      </div>
			<div class="form-group">
  				<div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-primary js-ajax-submit">提交</button>
  				</div>
			</div> 
		</div>		
    <div class="col-md-3">
        <table class="table table-bordered">
            <tr>
                <th><b>头像上传</b></th>
            </tr>
            <tr>
                <td>
                    <div style="text-align: center;">
                        <input type="hidden" name="post[avatar]" id="thumbnail" value="<?php echo $avatar; ?>">
                        <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                              
                                  <?php if(empty($avatar)): ?>
                                <img src="__TMPL__/public/assets/images/default-thumbnail.png"
                                     id="thumbnail-preview"
                                     width="135" height="130"  style="cursor: pointer;border-radius: 50%"/>
                                <?php else: ?>
                                <img src="<?php echo cmf_get_image_preview_url($avatar); ?>"
                                     id="thumbnail-preview"
                                     width="130" height="130" style="cursor: pointer;border-radius: 50%"/>
                            <?php endif; ?>
                                 
                        </a>
                        <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
                    </div>
                </td>
            </tr>
        </table>
    </div>
	</div>
	</form>
	
	</div>

<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>

<script  type="text/javascript">

$(function(){
  var role=JSON.parse('<?php echo $role; ?>');
  $('select[name=role_id] option').each(function(res){
    if($(this).context.value==role.id){
      $(this).prop('selected',true);
      return false;
    }
  });
});
</script>
</body>
</html>